package com.vzaar;

/**
 * User's public details along with it's relevant metadata.
 * 
 * @author Marc G. Smith
 */
public final class User 
{
	///////////////////////////////////////////////////////////////////////////
	// Private Members ////////////////////////////////////////////////////////
	///////////////////////////////////////////////////////////////////////////
	
	private double version;
	private String authorName;
	private int authorId;
	private String authorUrl;
	private int authorAccount;
	private String createdAt;
	private int videoCount;
	private int playCount;

	///////////////////////////////////////////////////////////////////////////
	// Public and Package Protected Methods ///////////////////////////////////
	///////////////////////////////////////////////////////////////////////////

	/**
	 * Package protected constructor.
	 * 
	 * @param version the vzaar API version number.
	 * @param authorName the vzaar user name (i.e. their login)
	 * @param authorId the vzaar user id 
	 * @param authorUrl a link to the vzaar user summary page
	 * @param authorAccount a number representing the users vzaar 
	 * 		account. 1 represents a free account
	 * @param createdAt the date time the video was uploaded. Will be 
	 * 		in UTC format
	 * @param videoCount the number of active videos in the users 
	 * 		account
	 * @param playCount the number of times all the users videos 
	 * 		have been played
	 */
	User(double version, String authorName, int authorId, String authorUrl,
		int authorAccount, String createdAt, int videoCount, int playCount) 
	{
		this.version = version;
		this.authorName = authorName;
		this.authorId = authorId;
		this.authorUrl = authorUrl;
		this.authorAccount = authorAccount;
		this.createdAt = createdAt;
		this.videoCount = videoCount;
		this.playCount = playCount;
	}

	///////////////////////////////////////////////////////////////////////////

	/**
	 * The vzaar API version number.
	 * 
	 * @return the vzaar API version number.
	 */
	public double getVersion() {
		return version;
	}

	///////////////////////////////////////////////////////////////////////////

	/**
	 * The vzaar user name (i.e. their login).
	 * 
	 * @return the vzaar user name (i.e. their login)
	 */
	public String getAuthorName() {
		return authorName;
	}

	///////////////////////////////////////////////////////////////////////////

	/**
	 * The vzaar user id
	 * @return the vzaar user id
	 */
	public int getAuthorId() {
		return authorId;
	}

	///////////////////////////////////////////////////////////////////////////

	/**
	 * The link to the vzaar user summary page.
	 * 
	 * @return the link to the vzaar user summary page
	 */
	public String getAuthorUrl() {
		return authorUrl;
	}

	///////////////////////////////////////////////////////////////////////////

	/**
	 * A number representing the users vzaar account. 1 represents a free 
	 * account.
	 * 
	 * @return A number representing the users vzaar account
	 */
	public int getAuthorAccount() {
		return authorAccount;
	}

	///////////////////////////////////////////////////////////////////////////

	/**
	 * The date time the video was uploaded. Will be in UTC format.
	 * 
	 * @return the date time the video was uploaded
	 */
	public String getCreatedAt() {
		return createdAt;
	}

	///////////////////////////////////////////////////////////////////////////

	/**
	 * The number of active videos in the users account.
	 * 
	 * @return the number of active videos in the users account
	 */
	public int getVideoCount() {
		return videoCount;
	}

	///////////////////////////////////////////////////////////////////////////

	/**
	 * The number of times all the users videos have been played.
	 * 
	 * @return the number of times all the users videos have been played
	 */
	public int getPlayCount() {
		return playCount;
	}
	
	///////////////////////////////////////////////////////////////////////////

	/**
	 * String representation of the user bean.
	 */
	public String toString() {
		return 
			"version=" + version +
			", authorName=" + authorName +
			", authorId=" + authorId +
			", authorUrl=" + authorUrl +
			", authorAccount=" + authorAccount +
			", createdAt=" + createdAt +
			", videoCount=" + videoCount +
			", playCount=" + playCount;
	}

	///////////////////////////////////////////////////////////////////////////
}
